package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.DeviceStatusIsisNeighbMapper;
import com.ruoyi.net.domain.DeviceStatusIsisNeighb;
import com.ruoyi.net.service.IDeviceStatusIsisNeighbService;

/**
 * 设备状态-isis邻居状态Service业务层处理
 * 
 * @author tony
 * @date 2024-12-18
 */
@Service
public class DeviceStatusIsisNeighbServiceImpl implements IDeviceStatusIsisNeighbService 
{
    @Autowired
    private DeviceStatusIsisNeighbMapper deviceStatusIsisNeighbMapper;

    /**
     * 查询设备状态-isis邻居状态
     * 
     * @param id 设备状态-isis邻居状态主键
     * @return 设备状态-isis邻居状态
     */
    @Override
    public DeviceStatusIsisNeighb selectDeviceStatusIsisNeighbById(String id)
    {
        return deviceStatusIsisNeighbMapper.selectDeviceStatusIsisNeighbById(id);
    }

    /**
     * 查询设备状态-isis邻居状态列表
     * 
     * @param deviceStatusIsisNeighb 设备状态-isis邻居状态
     * @return 设备状态-isis邻居状态
     */
    @Override
    public List<DeviceStatusIsisNeighb> selectDeviceStatusIsisNeighbList(DeviceStatusIsisNeighb deviceStatusIsisNeighb)
    {
        return deviceStatusIsisNeighbMapper.selectDeviceStatusIsisNeighbList(deviceStatusIsisNeighb);
    }

    /**
     * 新增设备状态-isis邻居状态
     * 
     * @param deviceStatusIsisNeighb 设备状态-isis邻居状态
     * @return 结果
     */
    @Override
    public int insertDeviceStatusIsisNeighb(DeviceStatusIsisNeighb deviceStatusIsisNeighb)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(deviceStatusIsisNeighb.getId())) {
            deviceStatusIsisNeighb.setId(uuid);
        }
        deviceStatusIsisNeighb.setCreateBy(SecurityUtils.getUsername());
        deviceStatusIsisNeighb.setCreateTime(DateUtils.getNowDate());
        deviceStatusIsisNeighb.setUpdateBy(SecurityUtils.getUsername());
        deviceStatusIsisNeighb.setUpdateTime(DateUtils.getNowDate());
        return deviceStatusIsisNeighbMapper.insertDeviceStatusIsisNeighb(deviceStatusIsisNeighb);
    }

    /**
     * 修改设备状态-isis邻居状态
     * 
     * @param deviceStatusIsisNeighb 设备状态-isis邻居状态
     * @return 结果
     */
    @Override
    public int updateDeviceStatusIsisNeighb(DeviceStatusIsisNeighb deviceStatusIsisNeighb)
    {
        deviceStatusIsisNeighb.setUpdateBy(SecurityUtils.getUsername());
        deviceStatusIsisNeighb.setUpdateTime(DateUtils.getNowDate());
        return deviceStatusIsisNeighbMapper.updateDeviceStatusIsisNeighb(deviceStatusIsisNeighb);
    }

    /**
     * 批量删除设备状态-isis邻居状态
     * 
     * @param ids 需要删除的设备状态-isis邻居状态主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusIsisNeighbByIds(String[] ids)
    {
        return deviceStatusIsisNeighbMapper.deleteDeviceStatusIsisNeighbByIds(ids);
    }

    /**
     * 删除设备状态-isis邻居状态信息
     * 
     * @param id 设备状态-isis邻居状态主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusIsisNeighbById(String id)
    {
        return deviceStatusIsisNeighbMapper.deleteDeviceStatusIsisNeighbById(id);
    }
}
